<template>
    <BasicDrawer
      v-bind="$attrs"
      @register="registerDrawer"
      title="应用详情"
      width="800px"
    >
    <Description :column="1" :data="appData" :schema="schema" :labelStyle="{ width: '120px' }" />
    </BasicDrawer>
  </template>
  <script lang="ts" setup>
    import { ref } from 'vue';
    import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
    import { Description, DescItem } from '@/components/Description';

    const schema: DescItem[] = [
      {
        field: 'name',
        label: '名称',
      },
      {
        field: 'detail',
        label: '描述',
        render: (curVal) => {
          return curVal?.desc;
        },
      },
      {
        field: 'detail',
        label: '首页',
        render: (curVal) => {
          return curVal?.url;
        },
      },
    ];
    
    const appData = ref({});
    const [registerDrawer] = useDrawerInner(async (data) => {
      appData.value = data.record.partner;
    });
  </script>
